3.50 \(\int \sin ^2(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=85 \[ -\frac{(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{1}{2} x (a-5 b) (a-b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

((a - 5*b)*(a - b)*x)/2 - ((a - 5*b)*(a - b)*Tan[e + f*x])/(2*f) + ((a - b)^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*
f) + (b^2*Tan[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.107452, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3663, 463, 459, 321, 203} \[ -\frac{(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{1}{2} x (a-5 b) (a-b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((a - 5*b)*(a - b)*x)/2 - ((a - 5*b)*(a - b)*Tan[e + f*x])/(2*f) + ((a - b)^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*
f) + (b^2*Tan[e + f*x]^3)/(3*f)

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rule 463

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> -Simp[((b*c - a*
d)^2*(e*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*b^2*e*n*(p + 1)), x] + Dist[1/(a*b^2*n*(p + 1)), Int[(e*x)^m*(a + b
*x^n)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + b^2*c^2*n*(p + 1) + a*b*d^2*n*(p + 1)*x^n, x], x], x] /; FreeQ[{a,
b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1]

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1))/(b*e*(m + n*(p + 1) + 1)), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a^2-6 a b+3 b^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}-\frac{((a-5 b) (a-b)) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}+\frac{((a-5 b) (a-b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{1}{2} (a-5 b) (a-b) x-\frac{(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac{(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.686095, size = 71, normalized size = 0.84 \[ \frac{6 \left (a^2-6 a b+5 b^2\right ) (e+f x)-3 (a-b)^2 \sin (2 (e+f x))+4 b \tan (e+f x) \left (6 a+b \sec ^2(e+f x)-7 b\right )}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(6*(a^2 - 6*a*b + 5*b^2)*(e + f*x) - 3*(a - b)^2*Sin[2*(e + f*x)] + 4*b*(6*a - 7*b + b*Sec[e + f*x]^2)*Tan[e +
 f*x])/(12*f)

________________________________________________________________________________________

Maple [B]  time = 0.045, size = 168, normalized size = 2. \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( -{\frac{\cos \left ( fx+e \right ) \sin \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) +2\,ab \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{5}}{\cos \left ( fx+e \right ) }}+ \left ( \left ( \sin \left ( fx+e \right ) \right ) ^{3}+3/2\,\sin \left ( fx+e \right ) \right ) \cos \left ( fx+e \right ) -3/2\,fx-3/2\,e \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{7}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{4\, \left ( \sin \left ( fx+e \right ) \right ) ^{7}}{3\,\cos \left ( fx+e \right ) }}-{\frac{4\,\cos \left ( fx+e \right ) }{3} \left ( \left ( \sin \left ( fx+e \right ) \right ) ^{5}+{\frac{5\, \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{4}}+{\frac{15\,\sin \left ( fx+e \right ) }{8}} \right ) }+{\frac{5\,fx}{2}}+{\frac{5\,e}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(sin(f*x+e)^5/cos(f*x+e)+(sin(f*x+e)^3+3/2*sin(f*x+e
))*cos(f*x+e)-3/2*f*x-3/2*e)+b^2*(1/3*sin(f*x+e)^7/cos(f*x+e)^3-4/3*sin(f*x+e)^7/cos(f*x+e)-4/3*(sin(f*x+e)^5+
5/4*sin(f*x+e)^3+15/8*sin(f*x+e))*cos(f*x+e)+5/2*f*x+5/2*e))

________________________________________________________________________________________

Maxima [A]  time = 1.58921, size = 117, normalized size = 1.38 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{3} + 3 \,{\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )}{\left (f x + e\right )} + 12 \,{\left (a b - b^{2}\right )} \tan \left (f x + e\right ) - \frac{3 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 3*(a^2 - 6*a*b + 5*b^2)*(f*x + e) + 12*(a*b - b^2)*tan(f*x + e) - 3*(a^2 - 2*a*b +
 b^2)*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.9561, size = 224, normalized size = 2.64 \begin{align*} \frac{3 \,{\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} f x \cos \left (f x + e\right )^{3} -{\left (3 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \,{\left (6 \, a b - 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/6*(3*(a^2 - 6*a*b + 5*b^2)*f*x*cos(f*x + e)^3 - (3*(a^2 - 2*a*b + b^2)*cos(f*x + e)^4 - 2*(6*a*b - 7*b^2)*co
s(f*x + e)^2 - 2*b^2)*sin(f*x + e))/(f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)**2*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*sin(e + f*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 2.2994, size = 1905, normalized size = 22.41 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/6*(3*a^2*f*x*tan(f*x)^5*tan(e)^5 - 18*a*b*f*x*tan(f*x)^5*tan(e)^5 + 15*b^2*f*x*tan(f*x)^5*tan(e)^5 + 3*a^2*f
*x*tan(f*x)^5*tan(e)^3 - 18*a*b*f*x*tan(f*x)^5*tan(e)^3 + 15*b^2*f*x*tan(f*x)^5*tan(e)^3 - 9*a^2*f*x*tan(f*x)^
4*tan(e)^4 + 54*a*b*f*x*tan(f*x)^4*tan(e)^4 - 45*b^2*f*x*tan(f*x)^4*tan(e)^4 + 3*a^2*f*x*tan(f*x)^3*tan(e)^5 -
 18*a*b*f*x*tan(f*x)^3*tan(e)^5 + 15*b^2*f*x*tan(f*x)^3*tan(e)^5 + 3*a^2*tan(f*x)^5*tan(e)^4 - 18*a*b*tan(f*x)
^5*tan(e)^4 + 15*b^2*tan(f*x)^5*tan(e)^4 + 3*a^2*tan(f*x)^4*tan(e)^5 - 18*a*b*tan(f*x)^4*tan(e)^5 + 15*b^2*tan
(f*x)^4*tan(e)^5 - 9*a^2*f*x*tan(f*x)^4*tan(e)^2 + 54*a*b*f*x*tan(f*x)^4*tan(e)^2 - 45*b^2*f*x*tan(f*x)^4*tan(
e)^2 + 12*a^2*f*x*tan(f*x)^3*tan(e)^3 - 72*a*b*f*x*tan(f*x)^3*tan(e)^3 + 60*b^2*f*x*tan(f*x)^3*tan(e)^3 - 9*a^
2*f*x*tan(f*x)^2*tan(e)^4 + 54*a*b*f*x*tan(f*x)^2*tan(e)^4 - 45*b^2*f*x*tan(f*x)^2*tan(e)^4 - 12*a*b*tan(f*x)^
5*tan(e)^2 + 10*b^2*tan(f*x)^5*tan(e)^2 - 12*a^2*tan(f*x)^4*tan(e)^3 + 36*a*b*tan(f*x)^4*tan(e)^3 - 30*b^2*tan
(f*x)^4*tan(e)^3 - 12*a^2*tan(f*x)^3*tan(e)^4 + 36*a*b*tan(f*x)^3*tan(e)^4 - 30*b^2*tan(f*x)^3*tan(e)^4 - 12*a
*b*tan(f*x)^2*tan(e)^5 + 10*b^2*tan(f*x)^2*tan(e)^5 + 9*a^2*f*x*tan(f*x)^3*tan(e) - 54*a*b*f*x*tan(f*x)^3*tan(
e) + 45*b^2*f*x*tan(f*x)^3*tan(e) - 12*a^2*f*x*tan(f*x)^2*tan(e)^2 + 72*a*b*f*x*tan(f*x)^2*tan(e)^2 - 60*b^2*f
*x*tan(f*x)^2*tan(e)^2 + 9*a^2*f*x*tan(f*x)*tan(e)^3 - 54*a*b*f*x*tan(f*x)*tan(e)^3 + 45*b^2*f*x*tan(f*x)*tan(
e)^3 - 2*b^2*tan(f*x)^5 + 24*a*b*tan(f*x)^4*tan(e) - 30*b^2*tan(f*x)^4*tan(e) + 18*a^2*tan(f*x)^3*tan(e)^2 - 3
6*a*b*tan(f*x)^3*tan(e)^2 + 10*b^2*tan(f*x)^3*tan(e)^2 + 18*a^2*tan(f*x)^2*tan(e)^3 - 36*a*b*tan(f*x)^2*tan(e)
^3 + 10*b^2*tan(f*x)^2*tan(e)^3 + 24*a*b*tan(f*x)*tan(e)^4 - 30*b^2*tan(f*x)*tan(e)^4 - 2*b^2*tan(e)^5 - 3*a^2
*f*x*tan(f*x)^2 + 18*a*b*f*x*tan(f*x)^2 - 15*b^2*f*x*tan(f*x)^2 + 9*a^2*f*x*tan(f*x)*tan(e) - 54*a*b*f*x*tan(f
*x)*tan(e) + 45*b^2*f*x*tan(f*x)*tan(e) - 3*a^2*f*x*tan(e)^2 + 18*a*b*f*x*tan(e)^2 - 15*b^2*f*x*tan(e)^2 - 12*
a*b*tan(f*x)^3 + 10*b^2*tan(f*x)^3 - 12*a^2*tan(f*x)^2*tan(e) + 36*a*b*tan(f*x)^2*tan(e) - 30*b^2*tan(f*x)^2*t
an(e) - 12*a^2*tan(f*x)*tan(e)^2 + 36*a*b*tan(f*x)*tan(e)^2 - 30*b^2*tan(f*x)*tan(e)^2 - 12*a*b*tan(e)^3 + 10*
b^2*tan(e)^3 - 3*a^2*f*x + 18*a*b*f*x - 15*b^2*f*x + 3*a^2*tan(f*x) - 18*a*b*tan(f*x) + 15*b^2*tan(f*x) + 3*a^
2*tan(e) - 18*a*b*tan(e) + 15*b^2*tan(e))/(f*tan(f*x)^5*tan(e)^5 + f*tan(f*x)^5*tan(e)^3 - 3*f*tan(f*x)^4*tan(
e)^4 + f*tan(f*x)^3*tan(e)^5 - 3*f*tan(f*x)^4*tan(e)^2 + 4*f*tan(f*x)^3*tan(e)^3 - 3*f*tan(f*x)^2*tan(e)^4 + 3
*f*tan(f*x)^3*tan(e) - 4*f*tan(f*x)^2*tan(e)^2 + 3*f*tan(f*x)*tan(e)^3 - f*tan(f*x)^2 + 3*f*tan(f*x)*tan(e) -
f*tan(e)^2 - f)